package com.supreme.nettyapp.generalserver.beatserver;

import com.supreme.nettyapp.generalserver.beatserver.service.BeatServerService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
@ConditionalOnProperty(prefix = "netty.beat-server", name = "enabled", havingValue = "true")
public class BeatServerStarter {

    @Resource
    private BeatServerService beatServerService;

    @PostConstruct
    private void beatServerStarter() {
        beatServerService.startNettyServer();
    }
}
